#ifndef WIDGET_H
#define WIDGET_H

#include <QOpenGLWidget>
#include <QOpenGLExtraFunctions>
#include <QOpenGLShaderProgram>
#include <QDebug>
#include <QOpenGLTexture>

class Widget : public QOpenGLWidget, protected QOpenGLExtraFunctions
{
public:
    Widget();
    ~Widget();

protected:
    virtual void initializeGL();
    virtual void resizeGL(int w, int h);
    virtual void paintGL();
private:
    //着色器程序
    QOpenGLShaderProgram* m_program;
    //位置
    GLuint m_posAttr;
    GLuint m_colorAttr;
    GLuint m_texCoordAttr;

    GLuint m_VAO[1];
    GLuint m_VBO[1];
    GLuint m_EBO[1];
    GLuint m_texture;

    QOpenGLTexture *m_textureBg;
};

#endif // WIDGET_H
